import request from '@/utils/request'

/*
|--------------------------------------------------------------------------
| 订单curl
|--------------------------------------------------------------------------
*/

// 查询长租订单列表 https://www.showdoc.com.cn/1872553987197478/8674685732104181
export function index(data) {
  return request({
    url: '/longOrder/basic/list',
    method: 'get',
    params: data
  })
}

// 长租订单导出 https://www.showdoc.com.cn/1872553987197478/8674708601335608
export function exportBasic(data) {
  return request({
    url: '/longOrder/basic/export',
    method: 'get',
    params: data
  })
}

// 新增长租订单 https://www.showdoc.com.cn/1872553987197478/8674488649608129
export function add(data) {
  return request({
    url: '/longOrder/basic',
    method: 'post',
    data,
  })
}

// 修改长租订单 https://www.showdoc.com.cn/1872553987197478/8677398895689196
export function put(data) {
  return request({
    url: '/longOrder/basic',
    method: 'put',
    data,
  })
}

// 取消长租订单 https://www.showdoc.com.cn/1872553987197478/8677474621278845
export function cancel(orderNos,id) {
  return request({
    url: '/longOrder/basic/cancel/' + orderNos+'/'+id,
    method: 'post',
  })
}

// 选择车型 https://www.showdoc.com.cn/1872553987197478/8680669402903437
export function classificationMoldelList(query) {
  return request({
    url: '/longOrder/basic/classificationMoldelList',
    method: 'post',
    params: query
  })
}

// 订单详情
export function detail(orderNo) {
  return request({
    url: '/longOrder/basic/' + orderNo,
    method: 'get'
  })
}

/*
|--------------------------------------------------------------------------
| 订单分配
|--------------------------------------------------------------------------
*/

// 配车--车辆列表 https://www.showdoc.com.cn/1872553987197478/8678663400574213
export function carlist(data) {
  return request({
    url: '/longOrder/basic/carList',
    method: 'post',
    data,
  })
}
// 配车--车辆列表 维保信息
export function carListByMaintenance(data) {
  return request({
    url: '/longOrder/basic/carListByMaintenance',
    method: 'get',
    params: data,
  })
}

// 确定配车 https://www.showdoc.com.cn/1872553987197478/8678685988093333
export function supplyCar(data) {
  return request({
    url: '/longOrder/basic/supplyCar',
    method: 'put',
    data,
  })
}

/*
|--------------------------------------------------------------------------
| 交车验车
|--------------------------------------------------------------------------
*/

// 新增交车验车 https://www.showdoc.com.cn/1872553987197478/8678853979458994
export function delivery(data) {
  return request({
    url: '/longOrder/basic/delivery',
    method: 'post',
    data,
  })
}

// 交车验车单 https://www.showdoc.com.cn/1872553987197478/8679375760970477
export function deliveryList(orderNo) {
  return request({
    url: '/longOrder/basic/deliveryInfo/' + orderNo,
    method: 'get',
  });
}


/*
|--------------------------------------------------------------------------
| 还车验车
|--------------------------------------------------------------------------
*/

// 还车验车收费项 https://www.showdoc.com.cn/1872553987197478/8681826333014615
export function alsoCarItems(data) {
  return request({
    url: '/longOrder/basic/alsoCarItems',
    method: 'get',
    params: data
  })
}

// 新增还车验车 https://www.showdoc.com.cn/1872553987197478/8679053572642010
export function alsoCarTest(data) {
  return request({
    url: '/longOrder/basic/alsoCarTest',
    method: 'post',
    params: data
  })
}

// 还车验车单列表 https://www.showdoc.com.cn/1872553987197478/8679391431891376
export function alsoCarTestInfo(orderNo) {
  return request({
    url: '/longOrder/basic/alsoCarTestInfo/' + orderNo,
    method: 'get',
  });
}

/*
|--------------------------------------------------------------------------
| 押金结算
|--------------------------------------------------------------------------
*/

// 押金结算页面 https://www.showdoc.com.cn/1872553987197478/8681891794201633
export function depositRefundDetail(orderNo) {
  return request({
    url: '/longOrder/basic/depositRefundDetail/' + orderNo,
    method: 'get'
  })
}

// 完成租车押金结算单 https://www.showdoc.com.cn/1872553987197478/8681898042975779
export function overDepositSettlement(orderNo) {
  return request({
    url: '/longOrder/basic/overDepositSettlement/' + orderNo,
    method: 'post',
  })
}

// 押金结算退款
export function depositRefund(orderNo,id) {
  return request({
    url: '/longOrder/basic/depositRefund/' + orderNo+'/'+id,
    method: 'post',
  })
}

/*
|--------------------------------------------------------------------------
| 申请换车
|--------------------------------------------------------------------------
*/
export function ChangeCar(data) {
  return request({
    url: '/longOrder/basic/ChangeCar',
    method: 'post',
    data,
  })
}

/*
|--------------------------------------------------------------------------
| 历史遗留
|--------------------------------------------------------------------------
*/



// 日志列表 https://www.showdoc.com.cn/1846525842933182/8496835659012726
export function operationLog(params) {
  return request({
    url: '/member/basic/operationLog',
    method: 'get',
    params: params
  })
}



// 短租订单费用明细 https://www.showdoc.com.cn/1846525842933182/8559520456211191
export function costDetail(orderNo) {
  return request({
    url: '/longOrder/basic/costDetail/' + orderNo,
    method: 'get'
  })
}

// 分配选择用户列表 https://www.showdoc.com.cn/1846525842933182/8549754158573497
export function geUserlist(params) {
  return request({
    url: '/longOrder/basic/geUserlist',
    method: 'get',
    params,
  })
}

// 短租订单分配业务员 https://www.showdoc.com.cn/1846525842933182/8550362185862696
export function distribution(data) {
  return request({
    url: '/longOrder/basic/distribution',
    method: 'put',
    data,
  })
}


// 线下收款 收取租金
export function chargeRent(orderNo) {
  return request({
    url: '/longOrder/basic/chargeRent/' + orderNo,
    method: 'post',
  })
}

// 线下收款 收取押金
export function chargeDeposit(orderNo) {
  return request({
    url: '/longOrder/basic/chargeDeposit/' + orderNo,
    method: 'post',
  })
}
// 线下收取补缴费用
export function confirmReceipt(id) {
  return request({
    url: '/longOrder/basic/confirmReceipt/' + id,
    method: 'get',
  })
}
//  线下意见收取补缴费用
export function confirmReceiptAll(orderNo) {
  return request({
    url: '/longOrder/basic/confirmReceiptAll/' + orderNo,
    method: 'get',
  })
}



